//player.h
#ifndef _PLAYER_H
#define _PLAYER_H

#include "deck.h"
#include <string>

class Player
{
 public:
  //Initializes a new player with no attributes
  Player();
  Player(string name, int size, int initBank);

  void DealCard(Deck& thisDeck);
  // The player is dealt a card from a deck
  // Preconditions: thisDeck is a valid deck
  // Postconditions the card(s) from thisdeck are added to the player's hand

  void PrintHand();
  // The player's hand is printed to cout
  // Preconditions: The player has a hand
  // Postconditions: The player's hand is printed to the terminal

  void PrintHandForClient();
  // Sends the player's hand to the connected client
  // Preconditions: needs to have a string to send
  // Postconditions: the string is sent to the client

  void SetName(string name);
  // The Name of the Player is set
  // Preconditions: The player has an undesirable name
  // Postconditions: The player's name is set to 'name'

  void ResetHand();
  // Sets playerIndex to 0
  // Preconditions: the player has a hand
  // Postconditions: that hand is discarded

  int BlackjackValue();
  //returns the numerical value of a players hand taking into account hard/soft Ace
  // Preconditions: the player has a hand of cards
  // Postconditions: the value of the cards is added up and returned

  void HardSoftAce();
  //tells the player the hard and soft values of their hand[]
  // Preconditions: the player has a hand
  // Postconditions: the value of their hand is couted


  void PlaceWager(int amt);
  // places bet and adjusts bank & wager
  // Preconditions: amt is less than or equal to the amount in the player's bank
  // Postconditions: the players bank is lowered.
  
  bool DoubleDown();
  //adjusts wager and bank for doubledownm returns true if able to doubledown, returns false if not able to doubledown
  // Preconditions: the player is about to be prompted what their next action is going to be
  // Postconditions: returns whether or not the player is able to doubledown

  void GetWinnings(int win); 
  //adds win to bank account sets wager to 0 
  // Preconditions: the player won a round
  // Postconditions: the bank is increased accordingly

  void LostHand();
  // The player's hand is lost
  // Preconditions: the player lost a round
  // Postconditions: Their wager s set to zero and their new bank amount is printed
  
  int GetWager();
  // Returns the player's current wager
  // Preconditions: none
  // Postconditions: the wager is returned

  const char* GetName();
  // Returns the player's name
  // Preconditions: none
  // Postconditions: the player's name is returmed

 private:
  //username
  string playerName;
  //max number of cards in hand will vary by game
  int handSize;
  //creates an array of size 52 with the index set to 0
  Cards* hand[52];
  //players chips/tokens
  int bank;	 
  int wager;
  int playerIndex;
};

#endif
